home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gsfont.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  3.1 KB  |  81 lines

  1. /* Copyright (C) 1989, 1993, 1996, 1997 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gsfont.h,v 1.2 2000/09/19 19:00:28 lpd Exp $ */
  20. /* Generic font and font cache interface */
  21. /* Requires gsmatrix.h */
  22.  
  23. #ifndef gsfont_INCLUDED
  24. #  define gsfont_INCLUDED
  25.  
  26. /* A 'font directory' object (to avoid making fonts global). */
  27. /* 'directory' is something of a misnomer: this structure */
  28. /* just keeps track of the defined fonts, and the scaled font and */
  29. /* rendered character caches. */
  30. #ifndef gs_font_dir_DEFINED
  31. #  define gs_font_dir_DEFINED
  32. typedef struct gs_font_dir_s gs_font_dir;
  33. #endif
  34.  
  35. /* Font objects */
  36. #ifndef gs_font_DEFINED
  37. #  define gs_font_DEFINED
  38. typedef struct gs_font_s gs_font;
  39. #endif
  40.  
  41. /* Initialization */
  42. /* These procedures return 0 if they fail. */
  43. gs_font_dir *gs_font_dir_alloc2(P2(gs_memory_t * struct_mem,
  44.                    gs_memory_t * bits_mem));
  45. gs_font_dir *gs_font_dir_alloc2_limits(P7(gs_memory_t * struct_mem,
  46.                       gs_memory_t * bits_mem,
  47.                       uint smax, uint bmax, uint mmax,
  48.                       uint cmax, uint upper));
  49.  
  50. /* Backward compatibility */
  51. #define gs_font_dir_alloc(mem) gs_font_dir_alloc2(mem, mem)
  52. #define gs_font_dir_alloc_limits(mem, smax, bmax, mmax, cmax, upper)\
  53.   gs_font_dir_alloc2_limits(mem, mem, smax, bmax, mmax, cmax, upper)
  54.  
  55. /* Font manipulations */
  56. /* Use gs_definefont only with original (unscaled) fonts! */
  57. int gs_definefont(P2(gs_font_dir *, gs_font *));
  58.  
  59. /* gs_scalefont and gs_makefont return 0 if the scaled font */
  60. /* was already in the cache, 1 if a new font was created. */
  61. int gs_scalefont(P4(gs_font_dir *, const gs_font *, floatp, gs_font **));
  62. int gs_makefont(P4(gs_font_dir *, const gs_font *, const gs_matrix *, gs_font **));
  63. int gs_setfont(P2(gs_state *, gs_font *));
  64. gs_font *gs_currentfont(P1(const gs_state *));
  65. gs_font *gs_rootfont(P1(const gs_state *));
  66. void gs_set_currentfont(P2(gs_state *, gs_font *));
  67. void gs_purge_font(P1(gs_font *));
  68.  
  69. /* Font cache parameter operations */
  70. void gs_cachestatus(P2(const gs_font_dir *, uint[7]));
  71.  
  72. #define gs_setcachelimit(pdir,limit) gs_setcacheupper(pdir,limit)
  73. uint gs_currentcachesize(P1(const gs_font_dir *));
  74. int gs_setcachesize(P2(gs_font_dir *, uint));
  75. uint gs_currentcachelower(P1(const gs_font_dir *));
  76. int gs_setcachelower(P2(gs_font_dir *, uint));
  77. uint gs_currentcacheupper(P1(const gs_font_dir *));
  78. int gs_setcacheupper(P2(gs_font_dir *, uint));
  79.  
  80. #endif /* gsfont_INCLUDED */
  81.